<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org"
       xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-equipInfo-detail" th:object="${equipInfo}">
            <input id="treeId" name="deptId" type="hidden" th:field="*{deptId}">
            <!-- 隐藏属性原样保存 -->
            <input id="equipId" name="equipId" type="hidden"th:field="*{equipId}">
            <input id="status" name="status" type="hidden" th:field="*{status}">
            <input id="delFlag" name="delFlag" type="hidden" th:field="*{delFlag}">

            <div class="form-group" th:remove="*{auditFlag=='1'}? body">
                <label class="col-sm-3 control-label">
                    <a class="btn btn-danger btn-del " onclick="auditPass()" shiro:hasPermission="equipment:audit:pass">
                        <i class="fa fa-edit"></i> 审核通过
                    </a>
                </label>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">部门名称：</label>
                <div class="form-control-static" th:text="*{dept.deptName}">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">名称型号：</label>
                <div class="form-control-static" th:text="*{namePn}">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">序列号：</label>
                <div class="form-control-static" th:text="*{serialNo}">
                </div>
            </div>
            <!-- TODO 可以参考新建菜单中 图标选择 -->
            <div class="form-group">	
                <label class="col-sm-3 control-label">负责人：</label>
                <div class="form-control-static" th:text="*{supervisorId}">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">审核状态：</label>
                <div class="form-control-static" th:text="*{@dict.getLabel('equip_info_audit', auditFlag)}">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">购置日期：</label>
                <div class="form-control-static" th:text="*{#dates.format(buyTime,'yyyy-MM-dd')}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">总价格：</label>
                <div class="form-control-static" th:text="*{totalPrice}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">高值设备：</label>
                <div class="form-control-static" th:text="*{@dict.getLabel('equip_info_value', valueFlag)}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">质保期(月)：</label>
                <div class="form-control-static" th:text="*{warranty}">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">放置地点：</label>
                <div class="form-control-static" th:text="*{place}">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">生产厂家：</label>
                <div class="form-control-static" th:text="*{manufacturer}">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">生产国家：</label>
                <div class="form-control-static" th:text="*{country}">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">售后电话：</label>
                <div class="form-control-static" th:text="*{supportPhone}">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">功能特色：</label>
                <div class="form-control-static" th:text="*{features}">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">规格及技术指标：</label>
                <div class="form-control-static" th:text="*{specification}">
                </div>
            </div>
		</form>
    </div>
    <div th:include="include::footer"></div>

    <script type="text/javascript">

		function auditPass() {
            $.modal.confirm("确认要审核通过吗?", function() {
                var equipId = $("input[name='equipId']").val();
                $.ajax({
                    type : "POST",
                    url : ctx + "equipment/audit/pass",
                    data : {
                        "ids":equipId,
                    },
                    async : false,
                    error : function(request) {
                        $.modal.alertError("系统错误");
                    },
                    success : function(data) {
                        $.operate.saveSuccess(data);
                    }
                });
            });
        }

	</script>
</body>
</html>
